var gulp=require("gulp");
var cssmin = require('gulp-cssmin');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var babel = require("gulp-babel");
var tinypng_nokey = require('gulp-tinypng-nokey');

//最完美的操作
gulp.task("default",()=>{
	gulp.src("src/*/*.css")
		.pipe(cssmin())
		.pipe(gulp.dest('dist'));
	
    gulp.src("src/*/*.js")
  		.pipe(babel())
  		.pipe(uglify())
    	.pipe(gulp.dest('dist'));
    	
   	gulp.src("src/*/*.{png,jpg,jpeg,gif,ico}")
   		.pipe(tinypng_nokey())
    	.pipe(gulp.dest('dist'));
    	
    gulp.src("src/*.html")
    	.pipe(gulp.dest('dist'));
    	
     gulp.src("src/font/*")
     	.pipe(gulp.dest('dist'));

})
